package cn.wolfcode.web.controller;

import cn.wolfcode.domain.Student;
import cn.wolfcode.qo.PageResult;
import cn.wolfcode.qo.QueryObject;
import cn.wolfcode.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private IStudentService studentService;

    @RequestMapping("/list")
    public String list(Model model, QueryObject qo){
        PageResult<Student> pageResult = studentService.query(qo);
          model.addAttribute("pageResult",pageResult);
          return "student/list";
    }
}
